import { getMockData } from "./mock-data";
import { getAllDates } from "../src/ts/unit-cal";
import { strictEqual } from "assert";
import { mom } from "../src/ts/utils-date";
import { solar2lunar, formatLunarDate } from "../src/ts/utils-lunar";


describe("test-unit-dates", async function () {

	it('unit-dates', async function () {
		const units = await getMockData();
		const unit = units[0];
		const dates = getAllDates(unit);

		// 测试语句，注释掉，先保留
		// let index = 1;
		// for (const d of nextDates) {
		// 	console.log(`${index}, ${d.format('YYYY-MM-DD')}, ${formatLunarDate(solar2lunar(d), "YMD")}`);
		// 	index++;
		// }
		strictEqual(dates.length, unit.count);
		strictEqual(units[0].lastBiddedDate.toISOString(), mom(dates[unit.biddedCount - 1]).toISOString());
	});


});